package com.lw.mall.service2.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lw.mall.entity.Product;
import com.lw.mall.mapper.ProductMapper;
import com.lw.mall.service2.ProductService2;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lw
 * @since 2022-09-25
 */
@Service("productServiceImpl2")
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService2 {


    @Override
    public void downProduct(Integer id) {
        final Product product = new Product();
        product.setId(id);
        product.setIsDown(1);
        baseMapper.updateById(product);
    }

    @Override
    public void upProductInProductList(Integer id) {
        final Product product = new Product();
        product.setId(id);
        product.setIsDown(0);
        baseMapper.updateById(product);
    }
}
